/**
 * 
 */
package com.cp16.tss.bo;

import com.cp16.tss.dao.CustomerDAO;
import com.cp16.tss.model.Customer;

/**
 * @author ADMIN
 *
 */
public class CustomerBO {

	private CustomerDAO customerDAO;
	
	public Customer getCustomerById(String customerId) throws Exception {
		return customerDAO.getCustomerById(customerId);
	}

	public Customer getCustomerByName(String customerName) throws Exception {
		return customerDAO.getCustomerByName(customerName);
	}

	public boolean addCustomer(Customer customer) throws Exception {
		if(customerDAO.addCustomer(customer)){
			return true;
		} else{
			return false;
		}
	}

	public boolean updateCustomer(Customer customer) throws Exception {
		if(customerDAO.updateCustomer(customer)){
			return true;
		}else{
			return false;
		}
	}

	public boolean deleteCustomer(Customer customer) throws Exception {
		if(customerDAO.deleteCustomer(customer)){
			return true;
		}else{
			return false;
		}
	}

	/**
	 * @return the customerDAO
	 */
	public CustomerDAO getCustomerDAO() {
		return customerDAO;
	}

	/**
	 * @param customerDAO the customerDAO to set
	 */
	public void setCustomerDAO(CustomerDAO customerDAO) {
		this.customerDAO = customerDAO;
	}

}
